package com.blog.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Value;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * Copyright (C), 2022
 * Author: 苏大大
 * Date: 2022-04-15 14:52
 * FileName: User
 * Description: 用户实体
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)    //开启链式写法
public class User  implements Serializable {
    @TableId(value = "uid")
    private Long uid;

    private String phone;

    private String username;

    private String password;


    private String avatar;

    //创建时间
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    //更新时间
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime updateTime;

    //上次登录ip
    private String lastIp;

    //
    private boolean dataStatus;
}
